<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><link rel="shortcut icon" href="http://localhost/qm_shop/./Qmshop/App/Index/Tpl/Public/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="http://localhost/qm_shop/./Qmshop/App/Index/Tpl/Public/css/common.css" />
<link rel="stylesheet" href="http://localhost/qm_shop/./Qmshop/App/Index/Tpl/Public/css/index.css" />
<script type='text/javascript' src='http://localhost/qm_shop/hdphp/hdphp/../hdjs/jquery-1.8.2.min.js'></script>
<link href='http://localhost/qm_shop/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/qm_shop/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/qm_shop/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/qm_shop/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/qm_shop';
		WEB = 'http://localhost/qm_shop/index.php';
		URL = 'http://localhost/qm_shop';
		HDPHP = 'http://localhost/qm_shop/hdphp/hdphp';
		HDPHPDATA = 'http://localhost/qm_shop/hdphp/hdphp/Data';
		HDPHPTPL = 'http://localhost/qm_shop/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/qm_shop/hdphp/hdphp/Extend';
		APP = 'http://localhost/qm_shop/index.php/Index';
		CONTROL = 'http://localhost/qm_shop/index.php/Index/Index';
		METH = 'http://localhost/qm_shop/index.php/Index/Index/index';
		GROUP = 'http://localhost/qm_shop/./Qmshop';
		TPL = 'http://localhost/qm_shop/./Qmshop/App/Index/Tpl';
		CONTROLTPL = 'http://localhost/qm_shop/./Qmshop/App/Index/Tpl/Index';
		STATIC = 'http://localhost/qm_shop/Static';
		PUBLIC = 'http://localhost/qm_shop/./Qmshop/App/Index/Tpl/Public';
		HISTORY = 'http://localhost/';
		HTTPREFERER = 'http://localhost/';
</script>
<script type="text/javascript" src='http://localhost/qm_shop/./Qmshop/App/Index/Tpl/Public/js/index.js'></script>
<!-- 头部开始 -->
	<div id="header">
		<div class="headBox">
			<div class="headTop">
					<div id="loginCart">
						<?php if(isset($_SESSION['uid']) && isset($_SESSION['username'])){?>
							<div class="fl fixed header_avatar">
								<a class="avatar_new" href="<?php echo U('User/index',array('uid'=>$_SESSION['uid']));?>">
									<img width="30" height="30" 
									<?php if(is_file($uheadimg)){?>
										src="<?php echo $uheadimg;?>"
									<?php  }else{ ?>
										src="http://localhost/qm_shop/./Qmshop/App/Index/Tpl/Public/images/avatar.php.jpg"
									<?php }?>>
								</a>
								<div class="username">
									<div class="n_username">
										<a href="<?php echo U('User/index',array('uid'=>$_SESSION['uid']));?>"><?php echo $_SESSION['username'];?> </a>
										<span style="color:#ff762d; font-size:12px;cursor:pointer" onclick="hd_ajax('<?php echo U('LogReg/logout');?>')">退出</span>
									</div>
								</div>
							</div>
						<?php  }else{ ?>
							<div class="login">
								<a href="<?php echo U('LogReg/login');?>">登陆</a>
								<a href="<?php echo U('LogReg/register');?>">注册</a>
							</div>
						<?php }?>
						<div class="cart">
							<a href="<?php echo U('Order/cart');?>">购物车<span class="head_n_kind allNum"><?php if(isset($_SESSION['cart'])){?><?php echo $_SESSION['cart']['total_rows'];?><?php  }else{ ?>0<?php }?></span>件</a>
						</div>
					</div>
					<h1 id="logo">
						<a href="<?php echo U('Index/index');?>"></a>
					</h1>
			</div>
			<div class="headBottom">
				<ul>
					<li class="homePage">
						<a href="<?php echo U('Index/index');?>">首页</a>
					</li>
					<li class="category">
						<a href="<?php echo U('Category/top_list');?>">分类</a>
						<div class="content">
							<div class="widget">
								<div class="cate">
									<div class="catetop fixed">
										<a href="<?php echo U('Category/top_list');?>">
											<p class="english" style="color:#f3142b;">CUSTOM</p>
											<p style="font-size:16px;">全部分类</p>
										</a>
										<a href="<?php echo U('Category/sub_list',array('order'=>'new'));?>">
											<p class="english" style="color:#78dd00;">NEW</p>
											<p style="font-size:16px;">最新</p>
										</a>
										<a href="<?php echo U('Category/sub_list',array('order'=>'hot'));?>">
											<p class="english" style="color:#ff6c00;">HOT</p>
											<p style="font-size:16px;">最热</p>
										</a>
										<a href="<?php echo U('Category/sub_list',array('order'=>'love'));?>">
											<p class="english" style="color:#ff48b4;">LOVE</p>
											<p style="font-size:16px;">喜欢最多</p>
										</a>
									</div>
									<div class="cateitem ct">
										<?php $hd["list"]["value"]["total"]=0;if(isset($topCate) && !empty($topCate)):$_id_value=0;$_index_value=0;$lastvalue=min(8,count($topCate));
$hd["list"]["value"]["first"]=true;
$hd["list"]["value"]["last"]=false;
$_total_value=ceil($lastvalue/1);$hd["list"]["value"]["total"]=$_total_value;
$_data_value = array_slice($topCate,0,$lastvalue);
if(count($_data_value)==0):echo "";
else:
foreach($_data_value as $key=>$value):
if(($_id_value)%1==0):$_id_value++;else:$_id_value++;continue;endif;
$hd["list"]["value"]["index"]=++$_index_value;
if($_index_value>=$_total_value):$hd["list"]["value"]["last"]=true;endif;?>

											<a target="_blank" href="<?php echo U('Category/sub_list',array('cid'=>$value['cid']));?>"><?php echo $value['cname'];?></a>
										<?php $hd["list"]["value"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
									</div>
									<div class="catetag">
										<?php if(is_array($category)):?><?php  foreach($category as $value){ ?>
											<dl class="fixed">
												<dt><?php echo $value['cname'];?>：</dt>
												<dd>
													<?php if(is_array($value['down'])):?><?php  foreach($value['down'] as $v){ ?>
														<a href="<?php echo U('Category/sub_list',array('cid'=>$v['cid']));?>"><?php echo $v['cname'];?></a>
													<?php }?><?php endif;?>
												</dd>
											</dl>
										<?php }?><?php endif;?>
									</div>
									<div class="catemore">
										<a href="<?php echo U('Category/top_list');?>">
											MORE 更多分类 >
										</a>
									</div>
									<div class="dot"></div>
								</div>
							</div>
						</div>
					</li>
					<?php if(is_array($chan)):?><?php  foreach($chan as $value){ ?>
					<li>
						<a href="<?php echo U('Category/sub_list',array('nid'=>$value['nid']));?>"><?php echo $value['nname'];?></a>
					</li>
					<?php }?><?php endif;?>
				</ul>
				<div class="search">
					<form action="<?php echo U('Search/index');?>" method="post">
						<input type="text" placeholder="请输入要搜索的关键词" name="keyword"/>
						<input type="submit" value="" class="searchBtn">
					</form>
				</div>
			</div>
		</div>
	</div>
<!-- 头部结束 -->